package com.film;

import com.film.service.MovieSystemDisplay;

import java.util.Scanner;

/**
 * @author HustleLr
 * @version 1.0.0
 * @date 2023/12/13 11:23
 * @describe MovieSelection
 */
public class MovieSelection {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        MovieSystemDisplay movieSystemDisplay = new MovieSystemDisplay();
        boolean showMenu = true;
        while (true) {
            if (showMenu) {
                movieSystemDisplay.displayMenu();
                int i = scanner.nextInt();
                scanner.nextLine();
                switch (i) {
                    case 1:
                        movieSystemDisplay.displayMovies();
                        showMenu = false;
                        break;
                    case 2:
                        movieSystemDisplay.displayReservations();
                        showMenu = false;
                        break;
                    case 3:
                        movieSystemDisplay.displayMovieHallInfo();
                        showMenu = false;
                        break;
                    case 4:
                        movieSystemDisplay.displayReservationInfo();
                        showMenu = false;
                        break;
                    case 0:
                        scanner.close();
                        System.exit(0);
                    default:
                        System.out.println("无效选择，请重新输入！");
                        showMenu = false;
                        break;
                }
            }
            System.out.print("按回车键继续，输入任何其他内容然后按回车键暂停...");
            String enterKey = scanner.nextLine();
            if (enterKey.isEmpty()) {
                showMenu = true;
                System.out.println();
                movieSystemDisplay.clearScreen();
            }
        }
    }
}
